﻿using Bootstrap.Control;
using Bootstrap.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Bootstrap.Demo
{
    public partial class Template : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            serverButton.ServerOnClick += serverButton_ServerOnClick;
            if (ThumbnailContainer.InnerList == null)
                ThumbnailContainer.InnerList = new List<BootstrapThumbnail>();

            var list = PostData.GetPostList().Take(3).ToList();


            foreach (var item in list)
            {
                ThumbnailContainer.InnerList.Add(new BootstrapThumbnail()
                {
                    HeaderText = item.Title,
                    Text = item.ShortDescription,
                    ImageUrl = item.ImageUrl,
                    OnClientClick = "onThumbnailClick($(this));"
                });
            }
        }

        void serverButton_ServerOnClick(object sender, EventArgs e)
        {
            serverButton.Text = "Hi Client(From Server)"; 

        }

     
    }
}